
	function ajaxFunction(){
		var ajaxRequest;  // The variable that makes Ajax possible!

		ajaxRequest = new XMLHttpRequest();
		
		// Create a function that will receive data sent from the server
		ajaxRequest.onreadystatechange = function(){
			if(ajaxRequest.readyState == 4){
				var ajaxDisplay = document.getElementById('formerrors');
				var response = ajaxRequest.responseText;
				var length = response.length;
				
				// Refresh the page is login is successful
				if(length > 0){
					ajaxDisplay.innerHTML = response;
				}else{
					window.location = "home.php";
				}
			}
		}
		var username = document.getElementById('username').value;
		var password = document.getElementById('password').value;
		var queryString = "?username=" + username + "&password=" + password;
		ajaxRequest.open("GET", "handle/login_ajax.php" + queryString, true);
		ajaxRequest.send(null);
	}